package com.hbnu.innerclass;

/**
 * @author kittychen
 * @date 2025-09-16 下午 3:44
 */
public class InnerDemo01 {

    private String username;

    private void method01() {
        System.out.println("外部类方法......");
        InnerClassDemo01 innerClassDemo01 = new InnerClassDemo01();
        System.out.println("外部类访问内部类私有属性：" + innerClassDemo01.gender);
        innerClassDemo01.innerMethod01();
    }

    public class InnerClassDemo01 {
        private String gender;

        public void innerMethod01() {
            System.out.println("内部类方法......");
            System.out.println("内部类访问外部类中的私有属性username:" + username);
            method01();
        }

    }
}
